package cn.wizzer.app.sys.modules.models.enums;

import cn.wizzer.framework.util.Result;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public enum BankUsesEnum implements Serializable {
    // 仅充值
    ONLY_RECHARGE("仅充值","ONLY_RECHARGE"),
    // 仅提现
    ONLY_WITHDRAW("仅代付","ONLY_WITHDRAW"),
    // 充值、提现
    R_W("充值、代付","R_W"),
    ;
    final public String NAME;
    final public String VALUE;

    BankUsesEnum(String name, String val) {
        NAME = name;
        VALUE = val;
    }

    public String getName() {
        return NAME;
    }

    public String getValue() {
        return VALUE;
    }


    public static List<Map<Object, Object>> toList(){
        BankUsesEnum[] values = BankUsesEnum.values();
        return Arrays.stream(values).map(enu -> Result.createHashMap("name", enu.NAME, "value", enu.VALUE))
                .collect(Collectors.toList());
    }
}
